package com.taxi.driver.util;

import android.content.Context;
import android.text.InputFilter;
import android.text.Spanned;
import android.widget.Toast;

import com.socks.library.KLog;

/**
 * Created by Administrator on 2017/8/30.
 */
public class SpaceFilter implements InputFilter {

    private Context mContext;

    public SpaceFilter(Context mContext) {
        this.mContext = mContext;
    }

    @Override
    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
        KLog.e(source);
        if (" ".equals(source)) {
            Toast.makeText(mContext, "8~16位大小写字母、数字及符号", Toast.LENGTH_SHORT).show();
            return "";
        }
        KLog.e(source);
        return source;
    }
}
